package com.shujia.six;

import org.junit.Test;

public class ArrayDemo1 {


    @Test
    public void test2() {
        boolean[] arr = new boolean[2];

        System.out.println(arr[1]);

        arr = null;

        // NullPointerException, 空指针异常
        System.out.println(arr[1]);
    }

    @Test
    public void test1() {
        // 数组越界, 访问的数组下标不存在
        double[] arr = new double[3];
        // ArrayIndexOutOfBoundsException, 数组越界异常
        System.out.println(arr[3]);
    }
}
